package chapter19;

import static chapter19.Outcome.*;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/1/19 14:44
 */
public enum RoShamBo2 implements Competitor<RoShamBo2> {
    /**
     * note
     */
    PAPER(DRAW, LOSE, WIN),
    SCISSORS(WIN, DRAW, LOSE),
    ROCK(LOSE, WIN, DRAW);

    private Outcome vPaper, vScissors, vRock;

    RoShamBo2(Outcome vPaper, Outcome vScissors, Outcome vRock) {
        this.vPaper = vPaper;
        this.vScissors = vScissors;
        this.vRock = vRock;
    }

    public static void main(String[] args) {
        RoShamBo.play(RoShamBo2.class, 20);
    }

    @Override
    public Outcome compete(RoShamBo2 competitor) {
        switch (competitor) {
            case PAPER:
                return vPaper;
            case SCISSORS:
                return vScissors;
            case ROCK:
                return vRock;
            default:
                return DRAW;
        }
    }
}
